package br.com.mtech.ctrlliberty.web.servlet.teste;

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.mtech.ctrlliberty.clientjar.ejb.ExemploEJBRemote;
import br.com.mtech.ctrlliberty.clientjar.entity.UsuarioVO;

/**
 * Servlet implementation class TesteServlet
 */
public class TesteServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	@EJB
	private ExemploEJBRemote exemploEJBRemote;
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		UsuarioVO usuario = new UsuarioVO();
		
		usuario.setNome("High Westland White Terrier");
		
		usuario = exemploEJBRemote.inserir(usuario);
		
		System.out.println("id do dog.: " + usuario.getId());
		
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
